<template>
  <d2-container>
    <template slot="header">获取RAN的配置信息</template>
    <el-button type="primary" plainn @click="getRanConfig">接口测试</el-button>
    <el-button type="primary" plainn @click="getsliceConfig"
      >获取切片配置</el-button
    >
    <br />
    <br />
    <json-viewer :value="jsonData" copyable :expand-depth=depth boxed v-show="showJsonData">
    </json-viewer>
  </d2-container>
</template>

<script>
import Axios from "axios";
export default {
  name: "page2",
  data() {
    return {
      jsonData: "",
      showJsonData: false,
      depth: 6,
    };
  },
  methods: {
    getRanConfig() {
      Axios({
        method: "get",
        url: "/api/stats/",
      }).then((res) => {
        this.showJsonData = true;
        this.jsonData = res.data;
      });
    },

    getsliceConfig() {
         Axios({
        method: "get",
        url: "/api/stats/",
      }).then((res) => {
        this.showJsonData = true;
        this.jsonData = res.data.eNB_config[0].eNB.cellConfig;
      });
    },
  },
};
</script>
